package com.lagou.edu.dao;

import com.lagou.edu.pojo.Age;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AgeDao extends JpaRepository<Age,Long>, JpaSpecificationExecutor<Age> {
    @Query("from Age where age=?1 and name=?2")
    List<Age> findByjPQL(Integer age,String name);

    @Query(value = "select * from tb_age where age=?1 and name like ?2",nativeQuery = true)
    List<Age> findBySQL(Integer age,String name);

    List<Age> findByAgeAndNameLike(Integer age,String name);
}
